import { message } from 'antd'


export const msg = (type, msg, time) => {
    time = time || 1
    var msgs
    switch (type) {
        case 'ok':
            msgs = message.success(msg, time)
            break;
        case 'war':
            msgs = message.warning(msg, time)
            break;
        case 'err':
            msgs = message.error(msg, 0)
            break;
        default:
            msgs = message.info(msg, time)
            break;
    }
    return msgs
}